package com.zyp.boot08.mapper;

import com.zyp.boot08.entity.Weibo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface WeiboMapper {
    @Insert("INSERT INTO weibo VALUES (NULL,#{content},#{url})")
    int insert(Weibo weibo);

    @Select("SELECT *FROM weibo")
    List<Weibo>select();

    @Delete("DELETE FROM weibo WHERE id=#{id}")
    int delete(int id);

    @Select("SELECT url FROM weibo WHERE id=#{id}")
    String selectUrlById(int id);
}
